<{include file="section/admin/admin_header.tpl"}>
<body>
<{include file="section/admin/admin_header_login_bar.tpl"}>
<div id="contentA" class="clear" style="width:1300px;">
	<!--leftsidebar sr-->
	<{include file="section/admin/admin_left_sidebar.tpl"}>
    <!--/leftsidebar end-->
    <div class="rightCont">
    	<!--path st-->
		<div class="path">您的位置：<a href="/">首页</a>&gt;<a href="/task/list">任务管理</a>&gt;  任务详情</div>
		<!--/path end-->
		
		<h2 class="title01"><span>任务管理-任务详情页面</span></h2>
        <div class="line1"></div>
			<ul id="tab">

			</ul>
			<div style="clear:both;"></div>
			<div class="line1"></div>
		<div class="boxform">
		<form action='/task/handle' method="post" name="frm" id="frm">
					<input type="hidden" name="action_id" id="action_id" value="" />
					<input type="hidden" name="task_id" id="task_id" value="" />
					<input type="hidden" name="reason_ee" id="reason_ee" value="" />
					<input type="hidden" name="task_type" id="task_type" value="<{$task_type}>" />
					<input type="hidden" name="category_sys" id="category_sys" value="" />
					<ul class="clear">
					<li class="i1">一、 任务详情</li>
					</ul>

					<ul class="clear">
					<li class="i1"><span class="red">*</span> 任务　ID：</li>
					<li><span class="in"><{$datas.task_id}></span></li>
					</ul>
					<ul class="clear">
					<li class="i1"><span class="red">*</span> 角　　色：</li>
					<li><span class="in"><{$datas.role_name}></span></li>
					</ul>
					<ul class="clear">
					<li class="i1"><span class="red">*</span> 任务类型：</li>
					<li><span class="in"><{$datas.type_name}></span></li>
					</ul>
					<ul class="clear">
					<li class="i1"><span class="red">*</span> 创建时间：</li>
					<li><span class="in"><{$datas.start_time}></span></li>
					</ul>
					<div class="line margin25"></div>				
					<ul class="clear">
					<li class="i1">二、 任务属性</li>
					</ul>
					
					<{if $type == 1}>
					<{if $pro_info.0 | @count > 0}>
					<ul class="clear">
					<li class="i1"><span class="red">*</span> 举报用户名:</li>
					<li><span class="in"><{$pro_info.0.uname}></span></li>
					</ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 商铺名称:</li>
                    <li><span class="in"><{$pro_info.0.shop_name}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 商品名称：</li>
                    <li><span class="in"><a href="<{$pro_info.0.goods_url}>" target="_blank"><{$pro_info.0.goods_title}></a></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 举报内容：</li>
                    <li><span class="in"><{$pro_info.0.content}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 举报图片：</li>
                    <li style='height:600px;'><span class="in">
						<{if $pro_info.0.image_url}>
							<{foreach from=$pro_info.0.image_url item=items}>
								<img src="<{$items}>" />
							<{/foreach}>
						<{/if}>
						</span></li>
                    </ul>	
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 举报时间：</li>
                    <li><span class="in"><{$pro_info.0.create_time}></span></li>
                    </ul>
					<{/if}>
					<{/if}>

					<{if $type == 2}>
					<{if $task_pdata.0 | @count > 0}>
					<!--<input type="hidden" name="category_sys_3" id="category_sys_3" value="" />-->
					<ul class="clear">
                    <li class="i1">商家名称: </li>
                    <li><span class="in"><a href="/member/detail/<{$task_pdata.0.apply_uid}>" target="_blank"><{$task_pdata.0.uname}></a></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1">商铺名称: </li>
                    <li><span class="in"><a href="<{$task_pdata.0.url}>" target="_blank"><{$task_pdata.0.shop_name}></a></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1">商铺申请的品牌分类: </li>
                    <li><span style="height:150px;">
						<{if $cate_ids | count >0}>
							<{foreach from=$cate_ids key=key item=cdata}>
							<dd><{if key == 0}>一<{/if}><{if key == 1}>二<{/if}><{if key == 2}>三<{/if}><{if key == 3}>四<{/if}>级分类： <{$cdata.name}></dd>
							<{/foreach}>
						<{else}>
							<dd>未选择分类</dd>
						<{/if}>
					</span></li>
                    </ul>

					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 1.选择导入商品品牌：</li>
                    <li><span style="height:200px;">
						<{include file="admin/task/js.tpl}>
							<dd style="height:30px;"><span class="li">请选择品牌所属一级分类：
							<select style="width:150px" name="category_sys_1" id="category_sys_1" onchange="brands_op.catesys_changed_brand(1, this.value, this.form.category_sys_2)">							
							<option value=" ">请选择分类</option>
							<{foreach from=$category_sys_1 item=item}>
								<option value="<{$item.id}>"><{$item.cate_name}></option>
							<{/foreach}>
							</select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys2"><span class="bk">请选择品牌所属二级分类：<select style="width:150px" name="category_sys_2" id="category_sys_2" onchange="brands_op.catesys_changed_brand(2, this.value, this.form.category_sys_3);"><option>请选择分类</option></select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys3"><span class="bk">请选择品牌所属三级分类：<select style="width:150px" name="category_sys_3" id="category_sys_3" onchange="brands_op.catesys_changed_brand(3, this.value, this.form.category_sys_4);"><option>请选择分类</option></select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys4"><span class="bk">请选择品牌所属四级分类：<select style="width:150px" name="category_sys_4" id="category_sys_4" onchange="brands_op.catesys_changed_brand(5, this.value, this.form.brand_id);"><option>请选择分类</option></select></span></dd>
						</span></li>
					<div style="display:none;"><select style="width:100px" name="brand_id" id="brand_id"><option></option></select></div>
                    </ul>

					<ul class="clear">
                    <li class="i1"> 品牌图片:</li>
                    <li><span class="in"><{if $task_pdata.0.logo_url}><img src="<{$task_pdata.0.logo_url}>" /><{/if}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌详情:</li>
                    <li><span class="in"><{$task_pdata.0.description}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌名字:</li>
                    <li><span class="in"><{if $task_pdata.0}><{$task_pdata.0.name}><{/if}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌申请时间:</li>
                    <li><span class="in"><{$task_pdata.0.create_time}></span></li>
                    </ul>
					<{/if}>
					<{/if}>

					<{ if $type == 3}>
					<{if $task_pdata | @count > 0}>
					<ul class="clear">
                    <li class="i1"> 商家名称:</li>
                    <li><span class="in"><a href="/member/detail/<{$task_pdata.0.apply_uid}>" target="_blank"><{$task_pdata.0.uname}></a></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 商铺名称:</li>
                    <li><span class="in"><a href="<{$task_pdata.0.url}>" target="_blank"><{$task_pdata.0.shop_name}></a></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 商铺申请的品牌分类:</li>
                    <li><span style="height:150px;">
						<{if $cate_ids | count >0}>
							<{foreach from=$cate_ids key=key item=cdata}>
							<dd><{if key == 0}>一<{/if}><{if key == 1}>二<{/if}><{if key == 2}>三<{/if}><{if key == 3}>四<{/if}>级分类： <{$cdata.name}></dd>
							<{/foreach}>
						<{else}>
							<dd>未选择分类</dd>
						<{/if}>
					</span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 1.选择导入商品品牌：</li>
                    <li><span style="height:200px;">
						<{include file="admin/task/js.tpl"}>
							<dd style="height:30px;"><span class="li">请选择品牌所属一级分类：
							<select style="width:150px" name="category_sys_1" onchange="brands_op.catesys_changed_brand(1, this.value, this.form.category_sys_2)">
							<option value=" ">请选择分类</option>
							<{foreach from=$category_sys_1 item=item}>
								<option value="<{$item.id}>"><{$item.cate_name}></option>
							<{/foreach}>
							</select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys2"><span class="bk">请选择品牌所属二级分类：<select style="width:150px" name="category_sys_2" id="category_sys_2" onchange="brands_op.catesys_changed_brand(2, this.value, this.form.category_sys_3);"><option>请选择分类</option></select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys3"><span class="bk">请选择品牌所属三级分类：<select style="width:150px" name="category_sys_3" id="category_sys_3" onchange="brands_op.catesys_changed_brand(3, this.value, this.form.category_sys_4);"><option>请选择分类</option></select></span></dd>
							<dd style="height:30px;display:none;" id="category_sys4"><span class="bk">请选择品牌所属四级分类：<select style="width:150px" name="category_sys_4" id="category_sys_4" onchange="brands_op.catesys_changed_brand(5, this.value, this.form.brand_id);"><option>请选择分类</option></select></span></dd>
						</span></li>
					<span style="display:none;"><select style="width:100px" name="brand_id" id="brand_id"><option></option></select></span>


                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌图片:</li>
                    <li><span style="height:200px;"><{if $task_pdata.0.logo_url}><img src="<{$task_pdata.0.logo_url}>" /><{/if}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌详情:</li>
                    <li><span class="in"><{$task_pdata.0.description}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"> 品牌名字:</li>
                    <li><span class="in"><{if $task_pdata.0}><{$task_pdata.0.name}><{/if}></span></li>
                    </ul>
					<ul class="clear">
                    <li class="i1"><span class="red">*</span> 品牌申请时间:</li>
                    <li><span class="in"><{$task_pdata.0.create_time}></span></li>
                    </ul>
					<{/if}>
					<{/if}>
				
					<div class="line margin25"></div>
					<ul class="clear">
					<li class="i1">三、 相关操作</li>
					</ul>
					
					<ul class="clear" style="height:230px;">
					<li class="i1"><span class="red">*</span> 备　　注：</li>
					<li><span class="in">
					<textarea name="reason" id="reason" cols="35" rows="5"></textarea><br/>
					<{foreach from=$datas.action item=act}>
						<input type="radio" name="sucess_result" id="sucess_result" value="<{$act.action_id}>" /><{$act.action_name}><br/>
					<{/foreach}>
					</span></li>
					</ul>


					<ul class="clear">
					<li class="i1"><span class="red">*</span> 操　　作：</li>
					<li><span class="in">
					<input class="btn04" type="button" name="onsubmit" value="提交" onclick="submit_task(<{$datas.task_id}>)"/>
					<input class="btn04" type="reset" name="onsubmit" value="取消" />
					</li>	
					</ul>
					</div>
				</form>
<script>
var status_cate	= <{$type}>;
function submit_task(task_id)
{

	if(!task_id)
	{
		alert('参数错误');

		return false;
	}

	var reason1	=  document.getElementById("reason").value;

	var ac_rs	=  document.frm.sucess_result.length;

	var statu_rs	= false;
	var action_id	= '';
	for(var k = 0; k< ac_rs ; k++)
	{
		
		if(document.frm.sucess_result[k].checked)
		{
			statu_rs = statu_rs || true;

			action_id = document.frm.sucess_result[k].value;
		}
	}
	if(! statu_rs)
	{
		alert('请选择相关操作再提交！');

		return false;	
	}
	var category_val	= '';
	if(status_cate == 3 || status_cate == 2)
	{
		var cate2 = document.getElementById("category_sys_2").value;
	
		var	cate3 = document.getElementById("category_sys_3").value;

		var cate4 = document.getElementById("category_sys_4").value;

		if(cate2 == '请选择分类')
			cate2 = '';
		if(cate3 == '请选择分类')
			cate3 = '';
		if(cate4 == '请选择分类')
			cate4 = '';
		
		if(cate2 || cate3 || cate4)
		{
			if(parseInt(cate2) > 0)
				category_val = cate2;
			if(parseInt(cate3) > 0)
				category_val = cate3;
			if(parseInt(cate4) > 0)
				category_val = cate4;
		}else{
			
			alert('请选择分类！');

			return false;
		}

		document.getElementById("category_sys").value = category_val;
	}
	//&& parseInt(selec)
	if(reason1){

		var reason	= document.getElementById('reason').value;

		document.getElementById('task_id').value = task_id;	
		
		document.getElementById('action_id').value = action_id;	
		
		document.getElementById('reason_ee').value = reason1;

		document.frm.submit();
		//document.getElementById('frm').submit();

	}else{

		alert('请填写理由');
	
		return false;
	}

}
</script>

			
		</div>
	</div>
</body>
</html>
